function date(startDateStr,endDateStr,step){
    const startDate=new Date(startDateStr);
    const endDate=new Date(endDateStr);
    const currentDate=startDate;
    const result=[];
    while(currentDate<=endDate){
        result.push(currentDate.toISOString().split('T')[0])
        currentDate.setDate(currentDate.getDate()+step)
    }
    return result;
}
const startTime='2023-04-10'
const endTime='2023-04-20'
const step=3;
console.log(date(startTime,endTime,step))